{__NOLAYOUT__}
<?php foreach($tree as $item): ?>
<dl class="cate-item">
    <dt class="cf am-g" style="font-weight:normal;">
        <div class="tb-name am-u-sm-4 show-hide-child">
            <?php echo str_repeat('&nbsp;&nbsp;&nbsp;' , $level); ?>
            <i class="show-icon am-icon-minus-circle"></i> <?php echo $item['title']; ?>
        </div>
        <div class="tb-model am-u-sm-2"><?php echo $item['type_str']; ?></div>
        <div class="tb-sort am-u-sm-1"><?php echo $item['sort_order']; ?></div>
        <div class="tb-opt am-u-sm-5">
            <div class="tpl-table-black-operation">
                <a href="<?php echo url("add?parent_id=".$item['id']); ?>"  class="tpl-table-black-operation-green">
                    <i class="am-icon-plus"></i> 添加栏目
                </a>
                <?php if(!isset($item['_child']) || count($item['_child']) < 0): ?>
                <a href="<?php echo url('doc?category_id='.$item['id']); ?>">
                    <i class="am-icon-envelope"></i> 文档管理
                </a>
                <?php endif; ?>
                <a href="<?php echo url('edit?category_id='.$item['id']); ?>">
                    <i class="am-icon-pencil"></i> 编辑
                </a>
                <a href="javascript:;" class="item-delete tpl-table-black-operation-del"
                    data-id="<?php echo $item['id']; ?>">
                    <i class="am-icon-trash"></i> 删除
                </a>
            </div>
        </div>
    </dt>
    <?php if(isset($item['_child']) && count($item['_child']) > 0): ?>
    <dd class="cat-child" style="margin-top:0px;" data-pid="<?php echo $item['id']; ?>">
        <?php action('Category/tree', ['tree'=>$item['_child'] , 'level'=>$level+1]); ?>
    </dd>
    <?php endif; ?>
    
</dl>
<?php endforeach; ?>